A photo-interrupter with a light-emitting device and a light-receiving device oppositely arranged apart from each other by a predetermined distance and integrated to each other detects whether or not there is an object between the light-emitting device and the light-receiving device on the basis of a change in an amount of light received by the light-receiving device. Such a photo-interrupter houses the light-emitting device and light-receiving device molded by translucent synthetic resin within a case molded by opaque synthetic resin.
FIG. 3 is a schematic longitudinal front view showing an example of a conventional photo-interrupter. In FIG. 3, reference numeral 20 denotes a photo-interrupter; 2 a case molded in a concave shape by opaque synthetic resin; and 3a, 3b hooks for hooking abase plate which are coupled with outer surfaces 2x and 2y located on left and right sides of the concave case 2, extended horizontally and bent vertically to form hook pieces 4a and 4b for hooking the base plate at their tips. These hooks 3a and 3b are molded by opaque synthetic resin integrally to the concave case 2.
Reference numerals 5a and 5b denote openings formed on left and right inner surfaces 2a and 2b of the concave case 2 which are opposite to each other. A light-emitting device 6 and a light-receiving device 7 are housed in spaces within the case 2. The light-emitting device 6 is provided with a lens 6a which projects forward. The light-receiving device 7 is provided with a lens 7a which projects forward.
The lens 6a and lens 7a are arranged oppositely to each other in the openings 5a and 5b so that the output light emitted from the light-emitting device 6 is received by the light-receiving device 7. As seen from a perspective view of FIG. 4, the opening 5a is formed in a groove shape having a prescribed length from the upper surface 2s. Reference numeral 5x denotes an end face of the opening 5a. The opening 5b is also formed in the same shape as that of the opening 5a. 
Numeral 6b denotes a lead terminal of the light-emitting device 6, whereas numeral 7b denotes a lead terminal of the light-receiving device 7. Numeral 8a denotes an adhesive which fixes the light-emitting device 6 to the side wall of the case 2, whereas numeral 8b denotes an adhesive which fixes the light-receiving device 7 to the side wall of the case 2.
A configuration in which the light-emitting device 6 and the light-receiving device 7 are fixed to the side walls of the case 2 using the adhesives 8a and 8b presents a problem of increasing the number of man-hours of assembling the photo-interrupter 20. Application of a small amount of adhesive will peel the light-emitting device 6 and light-receiving device 7. Therefore, the amount of the applied adhesive must be controlled appropriately. This presents a problem of making the process management complicated.
In order to overcome such an inconvenience, a photo-interrupter having a configuration in which the light-emitting device 6 and the light-receiving device 7 anchored to the case using pallets formed inside the case 2 has been developed. FIG. 5 is a schematic longitudinal front view of an example in which the light-emitting device 6 and the light-receiving element 7 are anchored using pallets 8x and 8y formed inside the case 2. In FIG. 5, like reference numerals refer to like parts in FIG. 3.
Where such pallets are formed inside the case 2, the bottoms of the light-emitting device 6 and the light-receiving device 7 are aligned with the pallets by warping the portion sandwiched by two slits passing through the side walls from the outer surfaces 2x and 2y of the concave case to the internal spaces.
FIG. 6 is a schematic perspective view showing an example in which the above two slits 9 having a prescribed length from the bottom of the case 2 are formed in the outer surface 2x. The slits 9 has a depth which reaches the space in which the light-emitting device 6 is housed inside the case 2 through the side wall. Similar slits are also formed in the outer surface 2y on the side in which the light-receiving device 7 is housed. With the light-emitting device 6 inserted into the internal space of the case 2, the portion of the outer surface 2x sandwiched by the two slits 9 is swung in a direction of arrow A so that it warps. Then, the light-emitting device 6 is anchored by the pallet formed inside the case.
FIG. 8 is a perspective view showing an example in which two slits 10 each having a prescribed length from the upper surface 2s of the case 2 are formed in the outer surface 2x to provide a portion 2c sandwiched therebetween.
FIG. 10 is a perspective view showing an example in which two slits 11 each having a prescribed length are formed centrally in the outer surface 2x. 
In the examples of FIGS. 8 and 10, the same slits as formed in the outer surface 2x are formed in the outer surface 2y. 
The configuration as illustrated in FIG. 5 in which the pallets for anchoring are formed inside the case has presented a problem that the mold is generally complicate. Further, as illustrated in FIG. 6, when the slits each having a prescribed length from the bottom of the case are formed in the left and right outer surfaces, as seen from a perspective view of FIG. 7, where the hooks 3a and 3b (3b not shown) for hooking the base plate are provided on the outer surfaces 2x and 2y to support the weight of the photo-interrupter, these hooks are coupled with the outer surfaces aside from the positions where the slits are formed.
This fact presented a problem that the assembled structure provides reduced mechanical strength and poor stability. In addition, the coupling portion between the hook for hooking the base plate and the outer surface of the case is unstable. This also presented a problem that the position of the hook piece, formed at the tip of the hook, relative to the base plate is not stable.
Further, as illustrated in FIG. 8, where two slits 10 each having a prescribed length from the upper surface 2s of the case 2 are formed, the hooks for hooking the base plate are formed on the left and right outer surfaces. This make it impossible to extend the slits downward. Therefore, as seen from a partial longitudinal front view of FIG. 9, where the light emitting device 6 inserted into the case 2 from a direction of arrow B is anchored by the pallet 8x provided inside the case 2, the portion 2c sandwiched between the two slits 10 is shortened so that it does not warp sufficiently in a direction of arrow. This presented a problem that the operation of anchoring the light-emitting device 6 becomes difficult. Likewise, the operation of anchoring the light-receiving device became difficult.
As seen from FIG. 10, where two slits each having a prescribed length are formed centrally in the left and right outer surfaces of the concave case, a sliding mold is required so that the mold structure becomes complicated. This presented a problem of an increase in the product price.
Further, traditionally, the semiconductor device such as a photo-interrupter has been attached to the base plate in such a manner that the attaching legs provided on the lower end of the semiconductor deice are inserted into the holes formed in the base plate.
FIG. 14 is an enlarged view of the attaching leg of a conventional interrupter. As seen from FIG. 14, the leg structure is provided with a wedge portion engaged with an edge of the hole of the base plate at the lower part of the thin elastic leg body which extends vertically downward from the interrupter. The wedge portion is composed of a flat plane which extends at an approximately right angle outwardly from the leg body and an inward sloping guide plane which is formed on the rear side of the flat plane 112a and is used to attach the leg in the hole of the base plate.
Therefore, in attaching the interrupter, since the interrupter is pushed into the hole of the base plate 117, the guide plane 112b is pushed in contact with the edge of the hole. As a result, the leg body bends and retreats inward because of its elasticity so that it is inserted into the hole. Subsequently, when the wedge portion at the lower end of the leg passes the hole, the leg is released from the pressure by the wall of the hole and bursts outward. The horizontal plane 112a is brought into contact with the rear side of the base plate and the wide portion 112c at the upper position of the leg so that the leg stops. Thus, the leg 112 is fixed to the base plate in such a fashion that its upper portion and lower portion are supported by the front surface and the lower surface of the base plate, respectively.
In the case of such a leg structure, if the interval between the upper wide portion 112c of the leg and the lower horizontal surface 112a is equal to the thickness of the base plate, i.e. is determined ideally, no gap is generated between the leg and the base plate so that the interrupter can be firmly anchored to the base plate at a right angle thereto.
However, actually, the thickness of the base plate and the size of the leg have an error in manufacture so that the thickness of the base plate cannot be made equal to the interval between the upper wide portion 112c and the lower horizontal plane 112a. Therefore, in the state where the interrupter is anchored to the base plate, the interrupter still rattles in the hole and its anchoring is not stable. The unstable anchoring makes it impossible to carry out an accurate detecting operation. In extreme cases, the interrupter cannot be used as a sensor.
Soldering the electrode of the semiconductor device to the electrode of the base plate results in shrinkage of the hardened solder paste. This exerts the shrinkage force between the semiconductor and the base plate so that the portion of the base plate attached to the semiconductor device may swell. In this case also, misregistration of the semiconductor device occurs. Where the semiconductor device is a sensor such as a photo-interrupter, there is a fear that an accurate detecting operation cannot be performed.
This invention has been accomplished in view of the problems described above. An object of this invention is to provide a photo-interrupter which can anchor a light-emitting device and a light-receiving device to a concave case in an expensive configuration, and couples hooks for hooking a base plate with the left and right outer surfaces of the case.
Another object of this invention is to provide an anchoring leg structure which permits a semiconductor device such as a photo-interrupter to be anchored to the base plate easily and surely in a simple structure.
Still another object of this invention is to provide a semiconductor device which can be prevented from floating because it is located properly even when a base plate floats due to shrinkage in the soldering paste.